package javango.api;

import com.google.inject.Injector;
import com.google.inject.Module;
import java.util.List;
import javango.core.contextprocessors.ContextProcessor;
import javango.middleware.Middleware;

/**
 * Base class for configuring javango framework. Extend this class and initialize it
 * in constructor via {@link Settings#setUrlsClass(java.lang.Class)}, 
 * {@link Settings#setMiddlewareClasses(java.lang.Class<? extends javango.middleware.Middleware>[])} and
 * {@link Settings#setContextProcessors(java.lang.Class<? extends javango.core.contextprocessors.ContextProcessor>[])}.
 * 
 */

public interface Settings {	
  Class<? extends Urls> getUrlsClass();
  List<Class<? extends Middleware>> getMiddlewareClasses();
  List<Class<? extends ContextProcessor>> getContextProcessorClasses();
  List<Class<? extends Module>> getModuleClasses();
  Injector createInjector(List<Module> moduleList);
  String get(String property);
  
  /**
   * Get the property value as a string,  if the property null defined return defaultValue
   * 
   * @param property
   * @param defaultValue
   * @return
   */
  String get(String property, String defaultValue);
  
  /**
   * Get the property value as an Integer,  if the property is null return defaultValue
   * 
   * @param property
   * @param defaultValue
   * @return
   * @throws NumberFormatException
   */
  Integer getAsInteger(String property, Integer defaultValue) throws NumberFormatException;
  
  String getDefaultCharset();
  boolean isDebug();
}